//
// Created by lenovo on 2024/7/2.
//
#include "./Collision.h"
namespace Game::Phy::Collision{
    void drawCollider(sf::RenderWindow& window, Game::Phy::Collision::AABB& aabb) {
        sf::RectangleShape rectangle(aabb.scale);
        rectangle.setPosition(aabb.position);
        rectangle.setFillColor(sf::Color::Transparent);
        rectangle.setOutlineThickness(1);
        rectangle.setOutlineColor(sf::Color::Red);
        window.draw(rectangle);
    }

    void drawCollider(sf::RenderWindow& window, Game::Phy::Collision::CircleCollider& circle) {
        sf::CircleShape shape(circle.radius);
        shape.setPosition(circle.position.x - circle.radius, circle.position.y - circle.radius);
        shape.setFillColor(sf::Color::Transparent);
        shape.setOutlineThickness(1);
        shape.setOutlineColor(sf::Color::Red);
        window.draw(shape);
    }

    void drawCollider(sf::RenderWindow& window, Game::Phy::Collision::PointCollider& point) {
        sf::CircleShape shape(2);
        shape.setPosition(point.position.x - 2, point.position.y - 2);
        shape.setFillColor(sf::Color::Red);
        window.draw(shape);
    }
}